/**
* \class AntlrAdapter
* \brief This class is used as an interface with the Parser and Lexer built using ANTLR
* Each rule that is set in the .g file has a resemblence to be called from C++ in this function
* \author Elie M. Shaccour (elie.shaccour@gmail.com)
* 
*/

#ifndef ANTLRADAPTER_H
#define ANTLRADAPTER_H

#include "C_typesParser.h"
#include "C_typesLexer.h"

class AntlrAdapter
{
private:
	pANTLR3_INPUT_STREAM input;
	pC_typesLexer lex;
	pANTLR3_COMMON_TOKEN_STREAM tokens;
	pC_typesParser parser;
	std::vector<int>	*mydata; ///< data returned

	/**     \brief Sets the structures to be used to connect with ANTLR 
        */
	void Set();

	/**     \brief Cleans the reserved structurs that connected with ANTLR
        */
	void Clean();
        std::string Output; ///< Holds the last returned output of any rule call
        std::string UserInput;  ///< Holds the last used input to any rule call
public:
	AntlrAdapter();
	~AntlrAdapter();

	/**	\brief Maps a C def statment to its corresponding specification using ANTLR rule
	*	\param Line C statement string containing a def
	*	\return Specification language set for def for the input as a string
	*/
	std::string Def(std::string Line);

        /**     \brief Maps a C use statment to its corresponding specification using ANTLR rule
        *       \param Line C statement string containing a use
        *       \return Specification language set for use for the input as a string
        */
	std::string Use(std::string Line);

        /**     \brief Returns the lines (x,y) as an int from a du<x,y> statment
        *       \param Line String in the format 'du<x,y>' where x and y are integers
        *       \return Vector of int containing the 'x' and the 'y'
        */
	std::vector<int>* TestCriteriaParameters(std::string Line);

	//int linescope(std::string line);
	//std::string functionname(std::string line);
	//std::string description(std::string line);
	//std::vector<std::string>* path(std::string line);
};

#endif
